import { createI18n } from "vue-i18n";

import en from "./langs/en.json";
import zh from "./langs/zh.json";

const i18n = createI18n({
  globalInjection: true,
  legacy: false,
  locale: localStorage.getItem("lang") || import.meta.env.VITE_APP_MAIN_LANG,
  fallbackLocale: import.meta.env.VITE_APP_MAIN_LANG,
  messages: {
    zh,
    en,
  },
});

export const supportLangs = ["en", "zh"];

export default i18n;
